﻿using System.Data;
using System.Data.SqlClient;
using System.Windows.Forms;

namespace QuanLyTuyenSinh.Operator
{
    public partial class Operator
    {
        public static DataTable GetListStudents()
        {
            _dtTable = new DataTable();
            string sql = "SELECT * From Students";
            try
            {
                _dtTable = DataConfig.GetDataTable(sql);
            }
            catch (SqlException ex)
            {
                MessageBox.Show(ex.ToString());
            }
            return _dtTable;
        }

        public static DataTable GetListStudentsById(long ethnicId)
        {
            _dtTable = new DataTable();
            string sql = string.Format("SELECT * FROM Students Where Id= N'{0}'", ethnicId);
            try
            {
                _dtTable = DataConfig.GetDataTable(sql);
            }
            catch (SqlException ex)
            {
                MessageBox.Show(ex.ToString());
            }
            return _dtTable;
        }
    }
}